﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FlyActionManager : SSActionManager {
    public DiskFlyAction fly;  
    public PhyFlyAction phyfly; 
    public FirstController scene_controller;           

    protected void Start() {
        scene_controller = (FirstController)SSDirector.GetInstance().CurrentScenceController;
        scene_controller.action_manager = this;     
    }
    // 对生成的飞碟给予动作，根据生成位置坐标 定义飞碟飞行的方向是左还是右
    public void DiskFly(GameObject disk, float angle, float power) {
        fly = DiskFlyAction.GetSSAction(( (disk.transform.position.x > 0)?-1:1 ), angle, power);
        this.RunAction(disk, fly, this);
    }
    public void PhyDiskFly(GameObject disk,float power){
        disk.GetComponent<Rigidbody>().isKinematic = false;
        int lor=1;
        if(disk.transform.position.x > 0) lor=-1;
        phyfly=PhyFlyAction.GetSSAction(lor,power);
        this.RunAction(disk,phyfly,this);
    }
}